<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>hello world</title>
	<meta charset="utf-8" />
	<script>var Promise2 = Promise;</script>
	<script src="../promise.js"></script>
</head>
<body>
	<div id="console" style="border:1px solid #ddd; padding:20px; border-radius:20px;"></div>
	<script>
var fun = function(Promise){
	console.time();
	var arr = [];

	for(var i = 0; i < 100000; i++){
		arr.push(new Promise(function(success){ success(); }));
	}

	return Promise.all(arr).then(function(){
		console.timeEnd();
	});
};

console.log("Promise1");
fun(Promise).then(function(){
	console.log("Promise2");
	fun(Promise2);
});
	</script>
	

	
</body>
</html>
